import json
import hashlib

def share_security_policy(policy, recipient):
    """
    共享安全策略
    :param policy: 安全策略
    :param recipient: 接收者
    :return: 共享成功
    """
    policy_json = json.dumps(policy)
    policy_hash = hashlib.sha256(policy_json.encode()).hexdigest()
    recipient.receive_policy(policy_json, policy_hash)
    return policy_hash

# 示例
policy = define_security_policy()
recipient = "Recipient"
policy_hash = share_security_policy(policy, recipient)
print(f"Policy shared with hash: {policy_hash}")